package sk.xorty;

import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;
import sk.xorty.domain.Person;
import sk.xorty.web.Model;
import sk.xorty.web.PersonController;

public class Main {

    public static void main(String[] args) {
        WeldContainer weld = new Weld().initialize();
        PersonController controller = weld.instance().select(PersonController.class).get();

        System.out.println("Invoking GET on controller");
        String getResponse = controller.get(new Model());
        System.out.println("Controller GET response: " + getResponse);

        Person bob = new Person("Bob", 33);
        System.out.println("Invoking POST on controller");
        String postResponse = controller.post(bob);
        System.out.println("Controller POST response: " + postResponse);
    }

}
